CXX      = c++
INCPATH  = -I. -Irtmath -Iobjects -Iobjects/primitives -Iobjects/luminaires -Imaterials -Itrajectories -Iorientations -Itools
LINK     = c++
LFLAGS   = 
LIBS     = -lm

CLASSES = \
		tools/tools.class \
		rtmath/triple.class \
		rtmath/color.class \
		rtmath/point.class \
		rtmath/vector.class \
		rtmath/ray.class \
		rtmath/rtmath.class \
		scene.class \
		serialscene.class \
		futurescene.class \
		frame.class \
		stopwatch.class \
		objects/object.class \
		objects/camera.class \
		objects/futurecamera.class \
		objects/serialcamera.class \
		objects/primitives/primitive.class \
		objects/primitives/sphere.class \
		objects/luminaires/luminaire.class \
		objects/luminaires/directluminaire.class \
		objects/luminaires/pointluminaire.class \
		materials/material.class \
		materials/mattematerial.class \
		materials/glossymaterial.class \
		materials/glassymaterial.class \
		materials/futureglassymaterial.class \
		materials/mirrormaterial.class \
		trajectories/trajectory.class \
		trajectories/lineartrajectory.class \
		trajectories/circulartrajectory.class \
		orientations/orientation.class \
		orientations/trackingorientation.class

HEADERS = \
		$(CLASSES:.class=.h)

SOURCES = \
		camera_test.cpp \
		$(CLASSES:.class=.cpp)

OBJECTS = $(SOURCES:.cpp=.o)

XMT_IIS = $(SOURCES:.cpp=.ii)

XMT_TIS = $(SOURCES:.cpp=.ti)

DESTDIR  = bin/
TARGET   = bin/sowilo

all: $(TARGET)

$(TARGET): $(OBJECTS) $(HEADERS)
	test -d bin/ || mkdir -p bin/
	test -d output/ || mkdir -p output/
	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
	

clean:
	rm -f $(OBJECTS) $(XMT_IIS) $(XMT_TIS) $(TARGET) $(TARGET).pl *~ core *.core
	